/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package utilitaire;

import com.mysql.jdbc.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author romain_lou
 */
public class Constantes {

    private static String TEST = "";
    private static Double d = 3.000000000;
    private static Double xs = 700000.0000;
    private static Double ys = 12655612.0499;
    private static Double n = 0.7256077650532670;
    private static Double c = 11754255.4261;
    private static Double e = 0.081819191042816;
    private static int campagneEnCours;
    private static String xmlPATH = "xmlPAC/";

    public static String getTEST() {
        return TEST;
    }

    public static void setTEST(String TEST) {
        Constantes.TEST = TEST;
    }

    public static Double getC() {
        return c;
    }

    public static void setC(Double c) {
        Constantes.c = c;
    }

    public static Double getD() {
        return d;
    }

    public static void setD(Double d) {
        Constantes.d = d;
    }

    public static Double getN() {
        return n;
    }

    public static void setN(Double n) {
        Constantes.n = n;
    }

    public static Double getXs() {
        return xs;
    }

    public static void setXs(Double xs) {
        Constantes.xs = xs;
    }

    public static Double getYs() {
        return ys;
    }

    public static void setYs(Double ys) {
        Constantes.ys = ys;
    }

    public static Double getE() {
        return e;
    }

    public static void setE(Double e) {
        Constantes.e = e;
    }

    public static int getCampagneEnCours() {
        Statement statement = null;
        ResultSet resultSet = null;

        try {

            statement = (Statement) GestionSQL.getConnection().getCon().createStatement();
            resultSet = statement.executeQuery("SELECT * FROM configuration");
            while(resultSet.next()){
                Constantes.setCampagneEnCours(resultSet.getInt("campagneEnCours"));
            }

        } catch (ClassNotFoundException ex) {
           utilitaire.Log.getLog().ecrireErreur(ex.getMessage());
        } catch (InstantiationException ex) {
            utilitaire.Log.getLog().ecrireErreur(ex.getMessage());
        } catch (IllegalAccessException ex) {
           utilitaire.Log.getLog().ecrireErreur(ex.getMessage());
        } catch (SQLException ex) {
            utilitaire.Log.getLog().ecrireErreur(ex.getMessage());
        }
        return campagneEnCours;
    }

    public static String getXmlPATH() throws ClassNotFoundException, ClassNotFoundException, SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException {

         /*Statement statement = (Statement) GestionSQL.getConnection().getCon().createStatement();
            ResultSet resultSet = statement.executeQuery("SELECT * FROM utilisateurs WHERE id_user = 46");

            String pathXML = null;
            while(resultSet.next()){
                pathXML = resultSet.getString("xmlPac");
            }

            if(pathXML == null || pathXML.equals("")){
                System.out.println("chemin introuvable...");
            }*/
        return xmlPATH;
    }



    public static void setCampagneEnCours(int campagneEnCours) {
        Constantes.campagneEnCours = campagneEnCours;
    }
}
